home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / gtu15.zip / GTU.DOC next >
Text File  |  1991-09-03  |  18KB  |  416 lines

  1. GTU - The GMUtant Text Utilities                          Version 1.4
  2.       (c) 1991 GMUtant Software
  3.  
  4.       GMUtant OnLine BBS: (703) 993-2219  1200/2400/9600 v.32
  5.  
  6. GTU is a collection of string processing utilities--gathered together in
  7. a semi-convenient package. Most are simple routines which you may well have
  8. already in single-application form.  The value of GTU (if indeed it has one),
  9. is that the routines are collected and run under a common syntax.
  10.  
  11. QUICKSTART: Enter GTU at the DOS prompt.  The opening screen shows the sorts
  12. of things GTU can do for you.  Enter an input file to process, an output file
  13. to hold the results of the processing, then select the desired option.
  14.  
  15. I. INTERACTIVE MODE.
  16.  
  17. If you enter GTU at the DOS prompt, you receive something like the
  18. following screen:
  19.  
  20. -------------------------------------------------------------------------------
  21. GTU - GMUtant Text Utilities Version #               (c) 19xx, GMUtant Software
  22. -------------------------------------------------------------------------------
  23. GTU filters files, creating an output file with the result of its work.
  24. As the prompts appear below, enter the name of your input and output files,
  25. Then choose a processing option enter its letter code (LUFRAPCNBSTW or Q).
  26. -------------------------------------------------------------------------------
  27. L -> Convert text in f1 to LOWER case.
  28. U -> Convert text in f1 to UPPER case.
  29. F -> Capitalize FIRST Letter Of Every Word In File.
  30. R -> REVERSE text in file (e.g., Hello world! -> !dlrow olleH)
  31. A -> ADD a 5 character left margin to your output file.
  32. P -> PULL left margin of text flush (zap leading spaces).
  33. C -> CENTER text in file on 80 character line.
  34. N -> Add line NUMBERS to file.
  35. B -> Strip Hi-bits from file (WordStar -> ASCII).
  36. S -> Add SOUNDEX code at start of each line.
  37. I -> Invert lines in f1.
  38. T -> TOTAL number of lines and words in f1.  Output file optional.
  39. W -> Extract unique WORDS in file. Produced sorted list.
  40. Q -> QUICKsort lines in file (625 lines maximum file size).
  41. G -> GO from ASCII to WordStar.
  42. Z -> ZAP multiple blank lines from input file.
  43. -------------------------------------------------------------------------------
  44.  Name of Input File:                  Name of Output File:
  45.  Processing Option [LUFRAPCNSTW or Q]:
  46.  
  47.  
  48.                       II. COMMAND LINE ARGUMENTS.
  49.  
  50. Should you desire, GTU has been designed to accept command line
  51. arguments.  Enter GTU /h at the DOS prompt for a help message
  52. Essentially, the form of your command is:
  53.  
  54. GTU x INPUTFILE OUTPUTFILE <cr>     where x is the processing
  55.                                     option desired.
  56.  
  57. For example, GTU X INPUT.FIL OUTPUT.FIL  would extract unique
  58. words in INPUT.FIL, sort them, then write them to OUTPUT.FIL
  59.  
  60.  
  61.                         III. PROCESSING OPTIONS
  62.  
  63. The options described below all use the QUICKSTART paragraph from the
  64. beginning of this documentation for sample output.
  65.  
  66. -----------------------------------------------------------------------
  67. L - converts a file to all upper case. Here's the 'quickstart' paragraph
  68.     seen earlier after 'L' processing:
  69.  
  70. quickstart: enter gtu at the dos prompt.  the opening screen shows the
  71. sorts of things gtu can do for you.  enter an input file to process, an
  72. output file to hold the results of the processing, then select the desired
  73. processing option.
  74. ---------------------------------------------------------------------------
  75. U - converts file to all upper case.
  76.  
  77. QUICKSTART: ENTER GTU AT THE DOS PROMPT.  THE OPENING SCREEN SHOWS THE
  78. SORTS OF THINGS GTU CAN DO FOR YOU.  ENTER AN INPUT FILE TO PROCESS, AN
  79. OUTPUT FILE TO HOLD THE RESULTS OF THE PROCESSING, THEN SELECT THE DESIRED
  80. PROCESSING OPTION.
  81.  
  82. ---------------------------------------------------------------------------
  83. F - capitalizes the first letter of each word.
  84.  
  85. Quickstart: Enter Gtu At The Dos Prompt.  The Opening Screen Shows The
  86. Sorts Of Things Gtu Can Do For You.  Enter An Input File To Process, An
  87. Output File To Hold The Results Of The Processing, Then Select The Desired
  88. Processing Option.
  89.  
  90. ---------------------------------------------------------------------------
  91. R - reverses strings in the file (why would you want to do this?  We
  92.     included it just because it's kinda neat). Might help you identify
  93.     undiscovered palindromes in your writing style...
  94.  
  95. eht swohs neercs gninepo ehT  .tpmorp SOD eht ta UTG retnE :TRATSKCIUQ
  96. na ,ssecorp ot elif tupni na retnE  .uoy rof od nac UTG sgniht fo stros
  97. derised eht tceles neht ,gnissecorp eht fo stluser eht dloh ot elif tuptuo
  98. .noitpo gnissecorp
  99.  
  100. ---------------------------------------------------------------------------
  101. A - adds a 5 character left margin.
  102.  
  103.  User enters a number for the right margin position. Any line with a length
  104.  less than this number will be padded on the left with spaces, yielding a
  105.  flush right margin. Lines longer than the number entered are not changed.
  106.  
  107.       QUICKSTART Enter GTU at the DOS prompt.  The opening screen shows the
  108.     sorts of things GTU can do for you.  Enter an input file to process, an
  109.  output file to hold the results of the processing, then select the desired
  110.                                                          processing option.
  111.  
  112. ---------------------------------------------------------------------------
  113. P - pulls text flush with 0 position in file.
  114.  
  115. QUICKSTART: Enter GTU at the DOS prompt.  The opening screen shows the
  116. sorts of things GTU can do for you.  Enter an input file to process, an
  117. output file to hold the results of the processing, then select the desired
  118. processing option.
  119.  
  120. ---------------------------------------------------------------------------
  121. C - centers strings in file on an 80 character line.
  122.  
  123.      QUICKSTART: Enter GTU at the DOS prompt.  The opening screen shows the
  124.     sorts of things GTU can do for you.  Enter an input file to process, an     
  125.    output file to hold the results of the processing, then select the desired   
  126.                                processing option.                               
  127.  
  128. Note: If GTU encounters a line longer than 80 characters, processing of option
  129. C is aborted.
  130.  
  131. ---------------------------------------------------------------------------
  132. S - soundex  Adds a 4 character SOUNDEX code before each line.  The first
  133.              word of the line is extracted and assigned a soundex code.
  134.  
  135. Q363 QUICKSTART Enter GTU at the DOS prompt.  The opening screen shows the
  136. S632 sorts of things GTU can do for you.  Enter an input file to process, an
  137. O313 output file to hold the results of the processing, then select the desired
  138. P625 processing option.
  139.              
  140. This option is useful if you use soundex filing in your paper files and want
  141. to create indexes of topics.  For example, enter a list of names, then
  142. run through GTU with the 'S' option.  Use the output file listing as your
  143. filing guide (after sorting via the Q option).
  144.  
  145. Soundex code generated: First letter of word plus 3 digits (e.g. A234).
  146.  
  147. ---------------------------------------------------------------------------
  148. N - add NUMBERS to lines.
  149.  
  150. 1 QUICKSTART Enter GTU at the DOS prompt.  The opening screen shows the
  151. 2 sorts of things GTU can do for you.  Enter an input file to process, an
  152. 3 output file to hold the results of the processing, then select the desired
  153. 4 processing option.
  154.  
  155. Blank lines are skipped and not assigned numbers.
  156.  
  157. -------------------------------------------------------------------------
  158. B - Strip Hi Bits.
  159.     This option will Un-Wordstar a file; that is, reset the 8th bit in
  160.     an ASCII file so that it displays correctly. If you look at a
  161.     WordStar file under DOS (e.g., type xxxx.doc <cr>), you'll see
  162.     lot's of funny looking characters--the extended ASCII character
  163.     set.  This option will reset those bytes to 7 bit characters.
  164.     Here's a sample of the process:
  165.  
  166. Before (a wordstar file):
  167.  
  168. Worδ oε NOTI╙ continue≤ t∩ preoccup∙ thσ System≤ Officσ¡-onσ looδ a⌠ ou≥ ì
  169. recentl∙ reviseΣ implementatioε calenda≥ suggest≤ thσ problem║ aε almos⌠ ì
  170. infinitσ variet∙ oµ task≤ competinτ fo≥ thσ attentioε oµ ß ver∙ finitσ ì
  171.  
  172. After the B option is run:
  173.  
  174. Work on NOTIS continues to preoccupy the Systems Office--one look at our 
  175. recently revised implementation calendar suggests the problem: an almost 
  176. infinite variety of tasks competing for the attention of a very finite 
  177.  
  178. --------------------------------------------------------------------------
  179. T - total words & lines in file.  Output file is optional.
  180.     If you do not want the information written to an output file,
  181.     press RETURN when asked for output file name.
  182.  
  183.  File processed: QUICKSTART
  184. Number of lines: 4
  185. Number of words: 30
  186.  
  187. ---------------------------------------------------------------------------
  188. W - extract unique words from input file. Creates sorted list of
  189.     these words in the output file. Beginning with release 1.0e these
  190.     words list to your output file 1 word to a line.
  191.  
  192.   an  at  can  desired  do
  193.   dos  enter  file  for  gtu
  194.   hold  input  of  opening  option
  195.   output  process  processing  prompt  quickstart
  196.   results  screen  select  shows  sorts
  197.   the  then  things  to  you
  198.  
  199. --------------------------------------------------------------------------
  200. Z - Zap Multiple blank lines.
  201.  
  202. This option is used primarily to shorten files ...files that have many
  203. blank lines in them.  For example, often you'll receive
  204. documentation files that are formatted for printing...each page is
  205. padded out with blank lines to fill a page.  Option Z will remove the
  206. 2nd through nth blank lines in a contiguous run...producing a file that
  207. prints out requiring less paper.
  208.  
  209. ---------------------------------------------------------------------------
  210. G - Go from ASCII -> WordStar.                      
  211.  
  212. This option removes the hard carriage return from within paragraphs.
  213. Spaces before text are padded out with soft spaces.  Running an ASCII
  214. file through GTU with the G option allows you to then reformat the
  215. document under WordStar.  This option is particularly useful for
  216. OCR applications.  Here's the effect of the G option on the
  217. QuickStart paragraph:
  218.  
  219. Before:
  220.  
  221. QUICKSTART: Enter GTU at the DOS prompt.  The opening screen shows the
  222. sorts of things GTU can do for you.  Enter an input file to process, an
  223. output file to hold the results of the processing, then select the desired
  224. processing option.
  225.  
  226. After:
  227.  
  228. QUICKSTART║ Ente≥ GT╒ a⌠ thσ DO╙ prompt«á Thσ openinτ screeε show≤ theì
  229. sort≤ oµ thing≤ GT╒ caε d∩ fo≥ you«á Ente≥ aε inpu⌠ filσ t∩ process¼ anì
  230. outpu⌠ filσ t∩ holΣ thσ result≤ oµ thσ processing¼ theε selec⌠ thσ desiredì
  231. processinτ option.
  232.  
  233. It looks ok under WordStar...
  234. ---------------------------------------------------------------------------
  235. Q - quick SORT of lines in input file:
  236.  
  237. QUICKSTART Enter GTU at the DOS prompt.  The opening screen shows the
  238. output file to hold the results of the processing, then select the desired
  239. processing option.
  240. sorts of things GTU can do for you.  Enter an input file to process, an
  241.  
  242. Note: Files longer than 625 lines will not be processed.  Further, if
  243. any line is longer than 85 characters, processing terminates.
  244. Sort order is strict ASCII (thus, upper case letters sort before
  245. lower case). If you want a case-insensitive sort, use GTU to first
  246. convert the file to all upper or all lower case.
  247.  
  248. -------------------------------------------------------------------------
  249. D - DETERMINE Character Frequency.
  250.  
  251. A rather interesting option, D is particularly useful if you're considering
  252. data compression...there may be other uses but I haven't thought of one...
  253.  
  254. Here's the report from our sample paragraph (named TEST.DOC) for this
  255. illustration:
  256.  
  257. Character frequency for file: TEST.DOC.  Characters read: 241
  258.  
  259. Character    Frequency        % of file
  260.  
  261. Space:        40        16.598
  262. ,        2        0.830
  263. .        3        1.245
  264. :        1        0.415
  265. A        5        2.075
  266. C        7        2.905
  267. D        5        2.075
  268. E        24        9.959
  269. F        5        2.075
  270. G        6        2.490
  271. H        10        4.149
  272. I        10        4.149
  273. K        1        0.415
  274. L        5        2.075
  275. M        1        0.415
  276. N        14        5.809
  277. O        19        7.884
  278. P        9        3.734
  279. Q        1        0.415
  280. R        12        4.979
  281. S        18        7.469
  282. T        25        10.373
  283. U        8        3.320
  284. W        1        0.415
  285. Y        1        0.415
  286.  
  287. The count of characters is NOT case sensitive; that is, 'a' and 'A' will be
  288. reported in the A column.  Values of 0 for a given character are not
  289. reported.
  290.  
  291. --------------------------------------------------------------------------
  292. E - Extend/Chop lines
  293.  
  294. This option will pad or chop all lines in a file to a given length.  For
  295. example, if you want all lines in your output file to be 100 characters,
  296. GTU will read your input file and add spaces to the lines less than 100
  297. and chop down to 100 characters, the lines that are longer.
  298. If GTU is chopping lines (say reducing all lines to 50 characters or less)
  299. it will wrap words that exceed the line limit to the next line. No information
  300. will be lost.
  301.  
  302. Here is the above paragraph when put through GTU's E option with a right
  303. margin of 50:
  304.  
  305. This option will pad or chop all lines in a file
  306. to a given length.  For example, if you want all
  307. lines in your output file to be 100 characters,
  308. GTU will read your input file and add spaces to
  309. the lines less than 100 and chop down to 100
  310. characters, the lines that are longer. If GTU is
  311. chopping lines (say reducing all lines to 50
  312. characters or less) it will wrap words that exceed
  313. the line limit to the next line. No information
  314. will be lost.
  315.  
  316. ---------------------------------------------------------------------------
  317. I - Invert lines in a file
  318.  
  319. Use this option to read in file 1 starting at the end, writing to f2 as
  320. it goes along.  The final result is to invert the order of the lines of
  321. file f1 in file f2.  Uses?  Well, if you sort a file then want to have
  322. it in descending order, you could use the I option. Here's the QUICKSTART
  323. paragraph after processing via option 'I':
  324.  
  325. processing option.
  326. output file to hold the results of the processing, then select the desired
  327. sorts of things GTU can do for you.  Enter an input file to process, an
  328. QUICKSTART: Enter GTU at the DOS prompt.  The opening screen shows the
  329.  
  330.  
  331. ---------------------------------------------------------------------------
  332. J - Collapse runs of spaces to a single space (option J only because at
  333.     this point we're running out of letters)...
  334.  
  335. Before:
  336.  
  337. QUICKSTART: Enter GTU at the DOS prompt.  The opening screen shows the sorts
  338. of things GTU can do for you.  Enter an input file to process, an output file
  339. to hold the results of the processing, then select the desired option.
  340.  
  341. After:
  342.  
  343. QUICKSTART: Enter GTU at the DOS prompt. The opening screen shows the sorts
  344. of things GTU can do for you. Enter an input file to process, an output file
  345. to hold the results of the processing, then select the desired option.
  346.  
  347. Note extra space between the 1st and 2nd sentence removed.  Anywhere more than
  348. 1 space occurs, under the J option, GTU will replace it with a single space.
  349. As you might expect, this option will play havoc on text files with columns!
  350.  
  351.  
  352.  
  353.                       IV. SYSTEM-WIDE LIMITATIONS
  354.  
  355. Generally speaking, there are few limits to the program.  Only options
  356. C (Center), X (Extract Unique Words) and Q (QuickSort lines in file)
  357. have specific limiting parameters.
  358.  
  359. Option C - no line longer than 80 characters.  If you have a line
  360.            longer, program will terminate.
  361.  
  362. Option X - No more than 625 unique words. No word longer than 85
  363.            characters.
  364.  
  365. Option Q - No more than 625 lines in file. No line longer than
  366.            85 characters.
  367.  
  368. -------------------------------------------------------------------
  369.                           V. REVISION HISTORY
  370.  
  371. Version  Description
  372.  
  373. 1.4      Chop/Extend function changed. Now when chopping lines to a
  374.          given length, any leftover words will be wrapped to the
  375.          next line in the output file. NO DATA WILL BE LOST.
  376.          Code in several other functions improved dramatically.
  377.  
  378.          Pad left w/ spaces changed to variable (user-defined)
  379.          number of spaces.
  380.  
  381.          Option J (replace runs of spaces) added.
  382.  
  383. 1.3      Internal use. Not distributed.
  384.  
  385. 1.2      Hack spaces off end of line
  386. 1.1      Color added to program for CGA/EGA systems. Original video
  387.          mode restored on exit.
  388.          Bug in Pull Flush left fixed.
  389.          Program action for all functions standardized--more or less.
  390. 1.0i     Invert lines function (Option I).
  391. 1.0h     Minor bug fixed on opening screen border.
  392. 1.0g     Extend/Chop function (E) added.
  393. 1.0f     Character frequency (D) option added.
  394. 1.0e     Z and G options added. WordStar -> ASCII conversion
  395.           improved (control codes now removed).
  396.           Unique word list now writes a single word to a line.
  397. 1.0d     mSORT changed to ZipSort (Zipsort also part of ZipKWIC system).
  398. 1.0c     Internal coding streamlined, 500 bytes shaved off EXE file.
  399.           mSORT utility program added to GTU package.
  400. 1.0b     Opening menu/instruction screen improved. Option B added.
  401. 1.0a     Option N (add line numbers to output file) added.
  402. 1.0      Initial release.
  403.  
  404. --------------------------------------------------------------------
  405.  
  406. Questions, comments, complaints, etc.
  407.  
  408. Waldo Grotophorst, Library Systems Office
  409. Fenwick Library, George Mason University
  410. 4400 University Drive, Fairfax, VA 22030
  411. (703) 993-2239
  412.  
  413.  GMUtant OnLine BBS: 703-993-2219  1200/2400/9600 v.32  24 hours a day
  414.  
  415. BITNET: WALLYG@GMUVAX
  416.